<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<div th:replace="~{index::index_head}"></div>
<body>
<div th:replace="~{index::index_header}"></div>
<main>
    <div class="lbox">
        <div class="weizhi">您现在的位置是：<a th:href="@{/}" class="classlinkclass">首页</a> > 搜索结果</div>
        <div class="blogs_search">
            <div th:if="${articlePages!=null and #lists.size(articlePages.getList())>0}" class="xt_search">
                系统搜索到以下文章符合<strong th:text="${query}">人</strong>的查询结果
            </div>
            <div th:if="${articlePages==null or #lists.size(articlePages.getList())==0}" class="xt_search">
                系统没有搜索到关于<strong th:text="${query}">人</strong>的文章
            </div>
            <ul th:if="${articlePages!=null and #lists.size(articlePages.getList())>0}">
                <li th:each="article,articleStat:${articlePages.getList()}">
                    <h2><a th:href="@{/article/details/{id}(id=${article.getArticleId()})}" target="_blank">[[${articleStat.count}]].
                        [[${article.getArticleTopic()}]]</a></h2>
                    <p th:text="${#strings.abbreviate(article.getArticleContent(),200)}"></p>
                    <span class="color_green">
                        <a style="color: inherit"
                           th:href="@{{baseUrl}/article/details/{id}(baseUrl=${baseUrl},id=${article.getArticleId()})}">[[${baseUrl}]]/article/details/[[${article.getArticleId()}]] - [[${#dates.format(article.getArticlePublishTime(),'yyyy-MM-dd')}]]</a>
                    </span> - <a class="color_purple"
                                 th:href="@{/category/details/{categoryId}/{userId}(categoryId=${article.getCategoryId()},userId=${article.getArticleUser()})}"
                                 target="_blank" th:text="${article.getArticleCategory()}">机械设计</a>
                </li>
            </ul>
        </div>
        <div class="pagelist" th:if="${articlePages.getTotal()>12}">
            <a title="总数">&nbsp;<b th:text="${articlePages.getTotal()}">17</b></a>
            <a th:if="${articlePages.isHasPreviousPage()}"
               th:href="@{/search/details(query=${query},page=${articlePages.getPrePage()})}">上一页</a>&nbsp;
            <a th:if="${!articlePages.isIsFirstPage()}" th:href="@{/search/details(query=${query},page=1)}">首页</a>
            <th:block th:each="pageNo:${articlePages.getNavigatepageNums()}">
                <b th:if="${pageNo==articlePages.getPageNum()}" th:text="${pageNo}">1</b>
                <a th:unless="${pageNo==articlePages.getPageNum()}"
                   th:href="@{/search/details(query=${query},page=${pageNo})}" th:text="${pageNo}">2</a>&nbsp;
            </th:block>
            <a th:if="${articlePages.isHasNextPage()}"
               th:href="@{/search/details(query=${query},page=${articlePages.getNextPage()})}">下一页</a>&nbsp;
            <a th:if="${!articlePages.isIsLastPage()}"
               th:href="@{/search/details(query=${query},page=${articlePages.getPages()})}">尾页</a>
        </div>
    </div>
    <aside class="rbox">
        <!--广告位-->
        <!--<div class="ad">
            <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
            &lt;!&ndash; Square_Ad_Index_1 &ndash;&gt;
            <ins class="adsbygoogle"
                 style="display:block"
                 data-ad-client="ca-pub-2311962880414013"
                 data-ad-slot="9594736108"
                 data-ad-format="auto"
                 data-full-width-responsive="true"></ins>
            <script>
                (adsbygoogle = window.adsbygoogle || []).push({});
            </script>
        </div>-->
        <!--热文-->
        <div class="hot_news">
            <p class="h_title">文章热榜</p>
            <ul th:if="${hotArticles!=null && !#lists.isEmpty(hotArticles)}">
                <li th:each="article,articleStat:${hotArticles}">
                    <a th:href="@{/article/details/{id}(id=${article.getArticleId()})}"
                       th:title="${article.getArticleTopic()}" target="_blank">
                        <i><img th:if="${article.getArticleFirstPicture()==null}"
                                src="https://uploadbeta.com/api/pictures/random/?key=BingEverydayWallpaperPicture"
                                th:alt="${article.getArticleTopic()}">
                            <img th:if="${article.getArticleFirstPicture()!=null}"
                                 th:src="@{${article.getArticleFirstPicture()}}" th:alt="${article.getArticleTopic()}"></i>
                        </i><em th:text="${articleStat.count}">1</em>
                        <h2 th:text="${article.getArticleTopic()}">无需电池！用3D打印塑料控制电子设备，还能监测用量和自动购物</h2>
                        <span th:text="${#dates.format(article.getArticlePublishTime(),'yyyy-MM-dd')}">2020-10-18</span>
                    </a></li>
            </ul>
        </div>
    </aside>
</main>
<div th:replace="~{index::index-footer}"></div>
</body>
</html>
